<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<link rel="stylesheet" href="panelistic3.0-electron.css">
	<script src="panelistic3.0-electron.js"></script>
	<title>title</title>
	<style type="text/css"></style>
	<script type="text/javascript">
		let $ = document.querySelector;
		let panelistic;
		const ip = require("ip")
		const fs = require("fs")
		var qr = require('qr-image');
		const electron = require("electron");
		window.onload=function() {
			panelistic = new Panelistic();
			panelistic.initialize();
			fs.writeFileSync(getuserdatapath()+'/qr.png',(qr.imageSync("http://"+ip.address()+":307/#"+JSON.parse(fs.readFileSync(getuserdatapath()+"/account")).account+"."+new Date().getTime()+"/"+"?"+"pw="+JSON.parse(fs.readFileSync(getuserdatapath()+"/account")).password)))
		}

		function cnnew() {
			// electron.ipcRenderer.sendToHost('alert','连接新设备','请扫描二维码连接设备<br>请确保设备处于同一局域网<span class="panelistic_placeholder_large"></span><img id="smart_code" src="'+getuserdatapath()+'/qr.png'+'" ondragstart="return false;" text="图片加载中" style="user-drag: none;">','关闭')
			electron.ipcRenderer.sendToHost('alert','该功能正在开发中','确定')
		}
		const remote = require("@electron/remote");
	</script>
</head>
<body>
	<div id="panelistic_content_sidebar_in" class="DM_fonttitlel">
		<h1>我的设备</h1>
			<h6>Lenovo-TBx605M</h6>
			<span class="panelistic_placeholder"></span>
			<div class="panelistic_panel">
				<div class="panelistic_panel_name">扫码连接</div><br><span class="panelistic_placeholder_large"></span>
				<input type="button" onclick="cnnew()" value="连接新设备">
			</div>
	</div>
</body>
</html>